package BDD;

import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import java.io.InputStream;

/**
 * Created by IntelliJ IDEA.
 * User: isen
 * Date: 19/01/12
 * Time: 10:00
 * To change this template use File | Settings | File Templates.
 */
public class DataBaseHelper extends SQLiteOpenHelper {
    public static final int DATABASE_VERSION = 4;
    public static final String DB_NAME = "projectdb";
    public static final String MAIN_TABLE = "projectTable";
    public static final String PERSON_NAME = "name";
    public static final String PLACE = "place";


    public static final String CREATE_TABLE=
            "CREATE TABLE " + MAIN_TABLE + " (_id TEXT PRIMARY KEY , " + PERSON_NAME + " TEXT, " + PLACE + " TEXT)";

    public DataBaseHelper(Context context) {
        super(context, DB_NAME, null, DATABASE_VERSION);
    }



    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(CREATE_TABLE);
        }

    @Override
    public void onUpgrade(SQLiteDatabase db, int i, int i1) {
        db.execSQL("DROP TABLE " + MAIN_TABLE);
        db.execSQL(CREATE_TABLE);
    }
    
    }
